/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */

package cn.webrx;

import org.jsoup.Jsoup;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * <p>Project: jse2303 - Ex3
 * <p>Powered by webrx On 2023-07-19 10:00:41
 * <p>描述：<p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Ex3 {
    public static void main(String[] args) throws Exception {
        //Scanner sc = new Scanner(System.in);
        //String uid = sc.nextLine();
        String uid = "140501198111035371";
        String id = String.format("https://qq.ip138.com/idsearch/index.asp?userid=%s&action=idcard", uid);
        //String txt = Jsoup.connect(id).get().select("p").toString();
        //System.out.println(txt);
        String txt = Jsoup.connect(id).get().toString();

        //System.out.println(txt);

        Pattern p = Pattern.compile("<p>([0-9 \\u4e00-\\u9fa5<br>]+)</p>");
        Matcher m = p.matcher(txt);
        while (m.find()) {
            System.out.println(m.group(1));
        }

    }
}
